<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:a="http://richfaces.org/a4j"
    template="/layout/admin_template.xhtml">

    <ui:define name="body">
    	<h:form>
    		<h:commandButton value="#{messages.add_percent_msg}" action="e_discount" immediate="true"/>    		
    		<h:commandButton value="#{messages.add_kadrons_msg}" action="e_discount_kadrons" immediate="true"/>    		
    		<h:panelGroup id="a_panel_id">
	    		<rich:dataTable id="ut_id" value="#{kDiscountListManager.discountList}" var="e" rows="20" width="100%">
	    			<rich:column styleClass="tac">
	    				<f:facet name="header">
	    					<h:outputText value="#{messages.id_msg}" />
	    				</f:facet>
	    				<h:commandLink action="#{kDiscountListManager.edit(e.discount)}" value="#{e.id}" title="#{messages.edit_msg}" immediate="true" />
	    			</rich:column>
	    			<rich:column>
	    				<f:facet name="header">
	    					<h:outputText value="#{messages.name_msg}" />
	    				</f:facet>
	    				<h:commandLink action="#{kDiscountListManager.edit(e.discount)}" value="#{e.discount.getName(klang)}" title="#{messages.edit_msg}" immediate="true" />
	    			</rich:column>
	    			<rich:column>
	    				<f:facet name="header">
	    					<h:outputText value="#{messages.valid_from_msg}" />
	    				</f:facet>
    					<h:outputText value="#{e.discount.validFrom}" />	    				
	    			</rich:column>
	    			<rich:column>
	    				<f:facet name="header">
	    					<h:outputText value="#{messages.valid_to_msg}" />
	    				</f:facet>
    					<h:outputText value="#{e.discount.validTo}" />	    				
	    			</rich:column>
	    			<rich:column>
	    				<f:facet name="header">
	    					<h:outputText value="#{messages.kadrons_msg}" />
	    				</f:facet>
    					<h:outputText value="#{e.discount.kadrons}" />	    				
	    			</rich:column>
	    			<rich:column>
	    				<f:facet name="header">
	    					<h:outputText value="#{messages.bonus_kadrons_msg}" />
	    				</f:facet>
    					<h:outputText value="#{e.discount.bonusKadrons}" />	    				
	    			</rich:column>
	    			<rich:column>
	    				<f:facet name="header">
	    					<h:outputText value="#{messages.active_msg}" />
	    				</f:facet>
    					<h:selectBooleanCheckbox value="#{e.discount.active}" disabled="true" />	    				
	    			</rich:column>
	    			<rich:column>
	    				<f:facet name="header">
	    					<h:outputText value="#{messages.discount_msg}(%)" />
	    				</f:facet>
    					<h:outputText value="#{e.discount.percent}" />	    				
	    			</rich:column>
	    			<f:facet name="footer">
		                <rich:datascroller renderIfSinglePage="false" />
		            </f:facet>
	    		</rich:dataTable>
    		</h:panelGroup>
    	</h:form>
    </ui:define>
</ui:composition>
